package com.bhdx.blog.test;

/**
 * @author luocheng
 * @date 2020/6/15-17:52
 */

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ListAndMap {

    public static void main(String[] args) {

        List<Map<String, Object>> listMaps = new ArrayList<Map<String, Object>>();

        Map<String, Object> map1 = new HashMap<String, Object>();
        map1.put("1", "a");
        map1.put("2", "b");
        map1.put("3", "c");
        listMaps.add(map1);

        Map<String, Object> map2 = new HashMap<String, Object>();
        map2.put("11", "aa");
        map2.put("22", "bb");
        map2.put("33", "cc");
        listMaps.add(map2);

        for (Map<String, Object> map : listMaps) {
            for (String s : map.keySet()) {
                System.out.print(s+"------"+map.get(s) + "  ");
            }
        }

    }
}
